import java.util.Arrays;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Lily
 * Date: 2024-10-28
 * Time: 21:04
 */
public class test_2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int n = in.nextInt();
            int[] arr = new int[n * 3];
            for (int i = 0; i < n * 3; i++) {
                arr[i] = in.nextInt();
            }
            Arrays.sort(arr);

            int top=3*n-2;
            long sum=0;
            while (n>0){
                sum+=arr[top];
                top-=2;
                n--;
            }
            System.out.println(sum);
        }
    }
}
